package com.muyu.product.mapper;

import com.muyu.common.core.domain.R;
import com.muyu.product.domain.ProductBrand;
import com.muyu.product.domain.ProductClassify;
import com.muyu.product.domain.ProductInfo;
import com.muyu.product.domain.ProductSku;
import com.muyu.product.domain.pojo.ProductInfoPO;
import com.muyu.product.domain.req.*;
import com.muyu.product.domain.vo.ProductInfoVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.PropertyValues;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @ClassName ProductMapper
 * @Description 描述
 * @Author ShiYu.Cui
 * @Date 2024/3/26 21:11
 */
@Mapper
public interface ProductMapper {

    Integer insertProduct(ProductInfoReq productInfoReq);
    ProductClassify selectCountByType(Integer productClassIfyId);
    ProductBrand getBrand(Integer productBrandId);

    Integer insertSku(@Param("productSkuList") List<ProductSkuReq> productSkuList);

    Integer insertSkuAttr(@Param("attrs") ArrayList<ProductSkuAttrReq> attrs);

    List<ProductInfoPO> productList(ProductInfoVo productInfoVo);

    Integer inertSpecialOffers(SpecialOffersReq specialOffers);

    Integer insertShopMember(ShopMemberReq shopMember);

    ProductInfoReq getProductDetailById(@Param("id") Integer id);

    SpecialOffersReq getSpecialOffers(@Param("offersId") Integer offersId);

    ShopMemberReq getShopMember(@Param("offersId") Integer offersId);

    List<ProductSku> getSkuById(@Param("id") Integer id);

    List<ProductSkuAttrReq> getSkuAttrById(@Param("skuIds") List<Long> skuIds);

    Integer updateProductInfo(ProductInfoReq productInfoReq);

    Integer updateSpecialOffers(SpecialOffersReq specialOffers);

    Integer updateShopMember(ShopMemberReq shopMemberReq);

    Integer updateSku(@Param("productSkuList") List<ProductSkuReq> productSkuList);

    Integer updateSkuAttr(@Param("attrs") ArrayList<ProductSkuAttrReq> attrs);
}
